package graph;

public class Edge {
	public Node a;
	public Node b;
	public Edge(Node a, Node b) {
		if (b.compareTo(a) > 0) {
			this.b = a;
			this.a = b;
		} else {
			this.a = a;
			this.b = b;
		}
	}
	@Override
	public String toString() {
		return a + "-" + b + "\n";
	}
	@Override
	public int hashCode() {
		return a.hashCode() + 7*b.hashCode();
	}
	@Override
	public boolean equals(Object o) {
		if (!(o instanceof Edge)) {
			return false;
		}
		Edge c = (Edge)o;
		return a.equals(c.a) && b.equals(c.b);
	}
}
